<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>js</title>
	<style>

	</style>
</head>
<body>
	<form action="go.php" id='fid'>
		<p>用户名：</p>
		<p><input type="text" id='ipt' value='小金'></p>
		<p>密码：</p>
		<p><input type="text" value='123456'></p>
		
		<p><input type="submit" value='ok'></p>
	</form>
</body>

<script>


	fidobj=document.getElementById('fid');
	fidobj.onsubmit=function(){

		r=confirm('您确认提交表单吗？');
		if(!r){
			return false;
		}
	}

</script>
</html>